      SUBROUTINE AUTOCO(Z,P,L,N,SIG)
      DIMENSION P(1)
      COMPLEX Z(1)
C     COMPUTE RAW TRANSFORM OF X.
      CALL DBLFFT(Z,N,-1)
C     COMPUTE RAW SPECTRUM.
      NH=N/2
      FN=FLOAT(N*L)
      DO 115 I=1,NH
      A=REAL(Z(I))
      B=AIMAG(Z(I))
  115 P(I)=(A*A+B*B)/FN
      NH1=NH+1
      P(NH1)=0.
      DO 116 I=2,NH
  116 P(N+2-I)=P(I)
C
C     COMPUTE INVERSE FFT OF RAW SPECTRUM TO OBTAIN AUTOCORRELATION OF X
      CALL DBLFFT(Z,N,1)
C
      A=REAL(Z(1))
      WRITE(6,5) A
   5  FORMAT(32H1AUTOCOVARIANCE AT THE ORIGIN = ,1PE10.3)
      SIG=SQRT(A)
      WRITE(6,6)
    6 FORMAT(1H ,50X,28H AUTOCORRELATION COEFFICIENT)
C     COMPUTE AUTOCORRELATION COEFFICIENT.
      DO 444 I=1,L
  444 Z(I)=Z(I)*(FLOAT(L))/(A*FLOAT(L+1-I))
      RETURN
      END
